<?php

$flogFile = 'logaccess.htm';
//the variables need to save
$user_ip = $_SERVER[REMOTE_ADDR];
$user_port = $_SERVER[REMOTE_PORT];
$servernames = $_SERVER[SERVER_NAME];
$user_referent = $_SERVER[HTTP_REFERER];
$user_requestime = $_SERVER[REQUEST_TIME];

$currentdate = date('Y-m-d H:i:s');

//save file flog
$open = fopen($flogFile, 'a+');
fwrite($open, "<b>Ip address: </b> " . $user_ip);
fwrite($open, "<b>Port: </b> " . $user_port);
fwrite($open, "<b>Request time: </b> " . $user_requestime);
fwrite($open, "<b>Datetime: </b> " . $currentdate);
fwrite($open, "<b>Servername: </b> " . $servernames);
fwrite($open, "<b>Referent: </b> " . $user_referent . "<br/>");

fclose($open);
?>